﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Orchard.Mvc.Routes;
using System.Web.Routing;
using System.Web.Mvc;

namespace Hub {

    public class Routes : IRouteProvider {

        public void GetRoutes(ICollection<RouteDescriptor> routes) {
            foreach (var routeDescriptor in GetRoutes())
                routes.Add(routeDescriptor);
        }

        public IEnumerable<RouteDescriptor> GetRoutes() {
            return new[] {
                new RouteDescriptor {
                    Route = new Route(
                        "Hub/Publish/",
                        new RouteValueDictionary {
                            {"area", "Hub"},
                            {"controller", "Publish"},
                            {"action", "Index"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary {
                            {"area", "Hub"}
                        },
                        new MvcRouteHandler())
                },

                new RouteDescriptor {
                    Route = new Route(
                        "Hub/{id}",
                        new RouteValueDictionary {
                            {"area", "Hub"},
                            {"controller", "Share"},
                            {"action", "Index"},
                            {"id", 0}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary {
                            {"area", "Hub"}
                        },
                        new MvcRouteHandler())
                }

            
            };
        }
    }
}
